package com.uzai.console.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author mingyang.chen create in 2023/3/29 17:36
 */
@Getter
@AllArgsConstructor
public enum WxworkFriendRequestScene {

    PRIVATE_WECHAT_QR_CODE(1, "扫描二维码"),
    PRIVATE_WECHAT_MOBILE(2, "手机号搜索"),
    PRIVATE_WECHAT_CARD(3, "好友分享名片"),
    PRIVATE_WECHAT_GROUP(4, "群内"),
    UN_KNOW(0, "未知来源"),


    ;

    private final Integer value;
    private final String label;

    public Integer getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    public static WxworkFriendRequestScene getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (WxworkFriendRequestScene type : WxworkFriendRequestScene.values()) {
            if (type.getValue().equals(id)) {
                return type;
            }
        }
        return null;
    }
}
